package org.zjx.prop.domain.model;

import lombok.Data;
import lombok.NoArgsConstructor;
import org.zjx.prop.domain.enums.ItemType;
import org.zjx.prop.domain.enums.SlotStatus;
import org.zjx.prop.domain.enums.SlotType;

/**
 * 道具槽位 - 仅记录位置信息
 */
@Data
@NoArgsConstructor
public class ItemSlot {
    private int id;              // 槽位唯一ID
    private SlotType slotType;   // 槽位类型
    private int position;           // 槽位索引
    private SlotStatus status;   // 槽位状态

    public boolean canInput(ItemTemplate itemTemplate) {
        if (itemTemplate == null) return false;

        ItemType itemType = itemTemplate.getType();
        return switch (this.slotType) {
            case EQUIPMENT -> itemType.isEquipment();
            case SPECIAL_EQUIP -> itemType == ItemType.SPECIAL_EQUIP;
            case PET_EQUIPMENT -> itemType == ItemType.PET_SKILL;
            case ARTIFACT_BAG, EQUIPPED_ARTIFACT -> itemType == ItemType.TALISMAN;
            default -> true;
        };
    }
}